/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.utn.tpsimulacion06.UI;

import com.utn.tpsimulacion06.Puerto;
import javax.swing.JButton;
import javax.swing.JFrame;
/**
 *
 * @author juan
 */
public class VentanaSimulacion extends javax.swing.JFrame {

    /**
     * Creates new form VentanaSimulacion
     */
    public VentanaSimulacion() {
        initComponents();
        this.btn_Simular.setAlignmentY(JButton.CENTER_ALIGNMENT);
        this.btn_Simular.setAlignmentX(JButton.CENTER_ALIGNMENT);
        this.setLocationRelativeTo(null);
        this.setExtendedState(JFrame.MAXIMIZED_BOTH);
      //  this.jScrollPane1.add(this.jTableSimulacion);
        //this.getContentPane().add(this.jTableSimulacion);
       // this.getContentPane().add(this.jScrollPane1);
       }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        btn_Simular = new javax.swing.JButton();
        jScrollPane1 = new javax.swing.JScrollPane();
        jTableSimulacion = new javax.swing.JTable();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setLocationByPlatform(true);

        btn_Simular.setText("Simular");
        btn_Simular.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btn_SimularActionPerformed(evt);
            }
        });

        jTableSimulacion.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        jTableSimulacion.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {
                "RELOJ(dias)", "EVT", "RND", "TPO ENTRE LLEGADAS", "PROX. LLEGADA", "EST. M1", "EST. M2", "INICIO TPO. DESC. G1", "RND G1", "2 GRUAS? ", "TPO DESC. G1", "TPO. RECALC. G1", "FIN DESC. G1", "EST. G1", "INICIO TPO. DESC. G2", "RND G2", "2 GRUAS? ", "TPO DESC. G2", "TPO. RECALC. G2", "FIN DESC. G2", "EST. G2", "COLA", "RND PROX BLOQl", "TPO ENTRE BLOQ", "TPO PROX BLOQ", "TPO FIN LIB REC", "ESTA BLOQ?", "TPO REST DESP BLOQ"
            }
        ) {
            Class[] types = new Class [] {
                java.lang.Double.class, java.lang.String.class, java.lang.Double.class, java.lang.Double.class, java.lang.Double.class, java.lang.Object.class, java.lang.String.class, java.lang.Double.class, java.lang.Double.class, java.lang.Boolean.class, java.lang.Double.class, java.lang.Double.class, java.lang.Double.class, java.lang.String.class, java.lang.Double.class, java.lang.Double.class, java.lang.Boolean.class, java.lang.Double.class, java.lang.Double.class, java.lang.Double.class, java.lang.String.class, java.lang.Integer.class, java.lang.Double.class, java.lang.Double.class, java.lang.Double.class, java.lang.Double.class, java.lang.Boolean.class, java.lang.Object.class
            };
            boolean[] canEdit = new boolean [] {
                false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, true, true
            };

            public Class getColumnClass(int columnIndex) {
                return types [columnIndex];
            }

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        jTableSimulacion.setAutoResizeMode(javax.swing.JTable.AUTO_RESIZE_OFF);
        jScrollPane1.setViewportView(jTableSimulacion);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addGap(285, 285, 285)
                        .addComponent(btn_Simular)
                        .addGap(0, 422, Short.MAX_VALUE))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 764, Short.MAX_VALUE)))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(btn_Simular)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 402, Short.MAX_VALUE)
                .addContainerGap())
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void btn_SimularActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btn_SimularActionPerformed
        this.jTableSimulacion.setShowHorizontalLines(true);
        this.jTableSimulacion.setShowVerticalLines(true);
//        this.jTableSimulacion.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
        Puerto p = new Puerto(this.jTableSimulacion);
        p.simular();
    }//GEN-LAST:event_btn_SimularActionPerformed

    /**
     * @param args the command line arguments
     */

   
    public static void main(String args[]) {
        //VentanaSimulacion v = new VentanaSimulacion();
        //v.setVisible(true);
        /*
         * Set the Nimbus look and feel
         */
        
        /*
         * Create and display the form
         */
       java.awt.EventQueue.invokeLater(new Runnable() {

            public void run() {
               new VentanaSimulacion().setVisible(true);
            }
        });
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton btn_Simular;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JTable jTableSimulacion;
    // End of variables declaration//GEN-END:variables
}
